package org.oslims.client.uicomponents.editbox;

import org.oslims.client.uicomponents.inputfields.DropDownInputField;
import org.oslims.domain.Request;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class AssignLabResponsibleBox {

	final DialogBox dialogBox = new DialogBox(false, true);
	final VerticalPanel boxPanel = new VerticalPanel();

	final DropDownInputField labResponsible = new DropDownInputField("labResponsible", "Lab Responsible: ", "80px", "200px");

	final HorizontalPanel buttonLine = new HorizontalPanel();
	final Button saveButton = new Button("Save");
	final Button cancelButton = new Button("Cancel");

	Request request = null;

	public AssignLabResponsibleBox() {
		boxPanel.add(labResponsible);

		buttonLine.add(saveButton);
		buttonLine.add(cancelButton);
		boxPanel.add(buttonLine);

		dialogBox.add(boxPanel);
	}

	public AssignLabResponsibleBox(Request request) {
		this();
		this.request = request;
	}

	public DropDownInputField getLabResponsibleBox() {
		return labResponsible;
	}

	public void show() {
		dialogBox.center();
	}

	public Request getRequest() {
		return request;
	}

	public void setRequest(Request request) {
		this.request = request;
	}

	public HasClickHandlers getSaveButton() {
		return saveButton;
	}

	public HasClickHandlers getCancelButton() {
		return cancelButton;
	}

	public void hide() {
		dialogBox.hide();
	}
}
